@if(modstart_config('PageNotice_Title')||modstart_config('PageNotice_Content'))
<div id="PageNotice" style="display:none;position:fixed;top:0;left:0;right:0;z-index:10000;padding:10px;background:var(--color-warning-light);color:var(--color-warning);text-align:center;box-shadow:0 0 20px var(--color-warning-light);">
    @if(modstart_config('PageNotice_Title'))
    <div class="title tw-font-bold">{{modstart_config('PageNotice_Title')}}</div>
    @endif
    @if(modstart_config('PageNotice_Content'))
    <div class="content">
        <div class="ub-html lg">
            {!! modstart_config('PageNotice_Content') !!}
        </div>
    </div>
    @endif
    <div class="close btn btn-warning btn-round">我知道了</div>
</div>
<script>
    $(function(){
        var cookieKey = "PageNoticeClosed_{{md5(modstart_config('PageNotice_Title').modstart_config('PageNotice_Content'))}}";
        $('#PageNotice').css('display',document.cookie.indexOf(cookieKey) == -1 ? 'block' : 'none');
        $('#PageNotice .close').on('click',function(){
            document.cookie = cookieKey+"=1;path=/";
            $('#PageNotice').remove();
        });
    });
</script>
@endif
